package com.zzj;

//import com.zzj.handle.WebSocket;
//import com.zzj.service.IChatFriendsService;
//import com.zzj.service.IChatService;
import com.zzj.handle.WebSocket;
import com.zzj.service.IChatFriendsService;
import com.zzj.service.IChatService;
import com.zzj.service.RedisService;
import com.zzj.utils.RedisUtil;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;


@SpringBootApplication
public class ChatApplication {
    public static void main(String[] args) {
        //        SpringApplication.run(ChatApplication.class,args);

        SpringApplication springApplication = new SpringApplication(ChatApplication.class);
        ApplicationContext applicationContext = springApplication.run(args);


        RedisUtil redisUtil = applicationContext.getBean(RedisUtil.class);
        RedisService redisService = applicationContext.getBean(RedisService.class);
        IChatFriendsService chatFriendsService = applicationContext.getBean(IChatFriendsService.class);
        IChatService chatService = applicationContext.getBean(IChatService.class);
        WebSocket.setChatService(chatService);
        WebSocket.setChatFriendsService(chatFriendsService);
        WebSocket.setRedisUtil(redisUtil);
        WebSocket.setRedisService(redisService);
    }
}
